package com.cn.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;


@RestController
public class OrderController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/orderId/{id}")
    public String orderId(@PathVariable("id") String id){
        String url = "http://user-service/userId/12";
        String template = restTemplate.getForObject(url, String.class);
        System.out.println(template);
        return "id";
    }
}
